﻿using System;
using Pay.TO;
using System.Collections.Generic;

namespace Pay.DTO {
	/// <summary>
	/// 微信、支付宝等提交基本请求
	/// </summary>
	[Serializable]
	public class native_model : head_req {
		public native_model() {
			binds = new List<bind_merchant_item>();
		}
		/// <summary>
		/// 分润分配集合，可空
		/// </summary>
		public List<bind_merchant_item> binds { get; set; }
		/// <summary>
		/// 订单号
		/// </summary>
		public string order_no { get; set; }
		/// <summary>
		/// 订单金额,分为单位
		/// </summary>
		public string tran_amount { get; set; }
		/// <summary>
		/// 商品描述
		/// </summary>
		public string body { get; set; }
		/// <summary>
		/// 商品的标题，该参数最长为 32 个  字符，京东支付、网关支付、快捷支付、QQ钱包为必填
		/// </summary>
		public string subject { get; set; }
		/// <summary>
		/// 支付成功后服务器回调该地址
		/// </summary>
		public string notify { get; set; }
		/// <summary>
		/// 通道
		/// </summary>
		public PayChannel pay_channel { get; set; }
		/// <summary>
		/// 结算类型:T0,T1
		/// </summary>
		public string settle_type { get; set; }
		/// <summary>
		/// 支付方式：微信扫码支付WXPAY_QR，支付宝扫码支付ALIPAY_QR，京东扫码支付JDPAY_QR,银联扫码支付UNIONPAY_QR，QQ钱包扫码支付QQ_QR，
		/// 微信付款码支付WXPAY_MICRO,支付宝款码支付ALIPAY_MICRO,
		/// 微信APP支付WXPAY_APP,支付宝APP支付ALIPAY_APP,
		/// 微信公众账号支付WXPAY_JS,支付宝服务窗支付ALIPAY_JS,
		/// </summary>
		public string pay_code { get; set; }
		/// <summary>
		/// 费率
		/// </summary>
		public decimal fee { get; set; }
		/// <summary>
		/// 结算费:以分为单位
		/// </summary>
		public int settle_fee { get; set; }

		/// <summary>
		/// 支付类型：不要给APP调用
		/// </summary>
		public PayType pay_type { get; set; }
		/// <summary>
		/// 支付渠道返回的订单号：不要给APP调用
		/// </summary>
		public string transaction_no { get; set; }
		/// <summary>
		/// 类型：收款1，升级2，订单3：不要给APP调用
		/// </summary>
		public int type { get; set; }

		/// <summary>
		/// 微信公众账号支付：子商户公众号下关注的用户openid
		/// </summary>
		public string openid { get; set; }
		/// <summary>
		/// 支付宝、微信APP、微信公众账号支付创建应用所生成的AppID
		/// </summary>
		public string appid { get; set; }
		/// <summary>
		/// 微信、支付宝付款码支付:授权码
		/// </summary>
		public string auth_code { get; set; }
		/// <summary>
		/// 京东支付:交易付款码：渠道是jdMicro必须
		/// </summary>
		public string token { get; set; }
		/// <summary>
		/// 银联扫码支付,QQ钱包扫码，微信公众账号支付：支付成功跳转路径
		/// </summary>
		public string front_notify { get; set; }
        /// <summary>
        /// 是否是微信公众号支付
        /// </summary>
        public bool is_wx_pub_account_pay { get; set; }
    }

	/// <summary>
	/// 通道扫码支付返回结果
	/// </summary>
	public class native_result : ApiResultMessage {
		/// <summary>
		/// 二维码串:交易类型为WXPAY_QR、ALIPAY_QR时有返回
		/// </summary>
		public string code_url { get; set; }
		/// <summary>
		/// 以下交易类型时有返回WXPAY_APP(WXPAY_APP返回json字符串组成，用户根据返回参数直接调用微信sdk进行支付)
		/// </summary>
		public string pay_info { get; set; }
		/// <summary>
		/// 商户订单号
		/// </summary>
		public string order_no { get; set; }
		/// <summary>
		/// 支付渠道返回的订单号
		/// </summary>
		public string transaction_no { get; set; }
	}

    public class native_h5_result : result_base {
        /// <summary>
        /// 二维码串:交易类型为WXPAY_QR、ALIPAY_QR时有返回
        /// </summary>
        public string code_url { get; set; }
        /// <summary>
        /// 以下交易类型时有返回WXPAY_APP(WXPAY_APP返回json字符串组成，用户根据返回参数直接调用微信sdk进行支付)
        /// </summary>
        public string pay_info { get; set; }
        /// <summary>
        /// 商户订单号
        /// </summary>
        public string order_no { get; set; }
        /// <summary>
        /// 支付渠道返回的订单号
        /// </summary>
        public string transaction_no { get; set; }
        /// <summary>
        /// 是否调起支付
        /// </summary>
        public bool is_open { get; set; }
    }
}
